/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Math;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 *
 * @author gamas
 */
public class Rimas {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws FileNotFoundException, IOException {

        File archivo = new File ("archivo.txt");
        FileReader fr = new FileReader (archivo);
        BufferedReader br = new BufferedReader(fr);
        String linea = br.readLine();
        System.out.println(linea);
        String linea2=br.readLine();
        System.out.println(linea2);
        String linea3=br.readLine();
        System.out.println(linea3);
        String linea4=br.readLine();
        System.out.println(linea4);


         if(linea.endsWith(linea3.substring(linea3.length()-3, linea3.length()))&&linea2.endsWith(linea4.substring(linea4.length()-3, linea4.length()))){
                System.out.println("Si rima las palabras");
            }
            else{
                System.out.println("No rima las palabras ");
            }
      }
}
